import Vue from "vue";
import Vuex from "vuex";
import * as getters from "./getters";
import moment from "moment";

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        resultList: "",
        activeIndex: 0,
        // 搜索参数
        searchForm: "",

        // detail页面参数
        detailParams: {},
    },
    mutations: {
        set_resultList: (state, value) => {
            state.resultList[value.index] = value.resultList;
        },
        set_active: (state, value) => {
            state.activeIndex = value.activeIndex;
        },
        SET_SEARCH(state, value) {
            state.searchForm = value;
        },
        SET_DETAILPARAMS(state, value) {
            state.detailParams = value;
        },
    },
    actions: {},
    modules: {},
    getters,
});
